﻿using log4net;
using System;
using System.Collections.Generic;
using System.Data;
using System.Reflection;
using System.Text;
using TradePublish.Entity;
using TradePublish.Dao;
namespace TradePublish.Service
{
    public class TradePublishManager
    {
        private ILog log = null;
        private TradePublishDao tradePublishDao;

        public TradePublishManager()
        {
            this.log = log4net.LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
            this.tradePublishDao = new TradePublishDao();
        }

        public void deleteById(int id)
        {
            this.tradePublishDao.deleteById(id);
        }

        public DataSet findClientTask(int length )
        {
            return this.tradePublishDao.findClientTask(length );
        }
  

        public DataSet findTopUnGraspTMImage(int length )
        {
            return this.tradePublishDao.findTopUnGraspTMImage(length );
        }

        public DataSet findTopUnSendEmail(int length, int minId)
        {
            return this.tradePublishDao.findTopUnSendEmail(length, minId);
        }
         

        public DataSet findUnFinishedTask(int length)
        {
            return this.tradePublishDao.findUnFinishedTask(length);
        }

        public void insertHasAnalyGif(int ISSUE, int category, string regNo, string gif)
        {
            this.tradePublishDao.insertHasAnalyGif(ISSUE, category, regNo, gif);
        }

        public int saveAntiSearchResult(List<AntiSearchResult> results, List<string[]> details, int tradePublisCls, int tradePublishIssue)
        {
            return this.tradePublishDao.saveAntiSearchResult(results, details, tradePublisCls, tradePublishIssue);
        }

        public void setHasAntiSearch(int id, int saveCount)
        {
            this.tradePublishDao.setHasAntiSearch(id, saveCount);
        }

        public void setHasGraspImage(int id)
        {
            this.tradePublishDao.setHasGraspImage(id);
        }
         

        public void setHasStatusSearch(int id)
        {
            this.tradePublishDao.setHasStatusSearch(id);
        }

        public void updateTradePublish(int id, string[] detial,Boolean isOcrSccuss)
        {
            //string str = this.tradePublishDao.verifyHas(id);
            this.tradePublishDao.updateTradePublish(id, detial,  isOcrSccuss);
        }
    }

}